﻿using KMCCC.Authentication;
using KMCCC.Launcher;
using Panuon.UI.Silver;
using System.Linq;

namespace FMCL
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : WindowX   ///主函数？
    {
        public static LauncherCore Core = LauncherCore.Create();
        public MainWindow() ///窗口主体？
        {
            InitializeComponent();
            var versions = Core. GetVersions().ToArray();
            versionCombo.ItemsSource = versions;
        }

        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var ver = (KMCCC.Launcher.Version)versionCombo.SelectedItem;
            var result = Core.Launch(new LaunchOptions
            {
                Version = ver,
                MaxMemory = 1024,
                Authenticator = new OfflineAuthenticator("Mikoto"),
                Mode = LaunchMode.MCLauncher,
            });
        }
    }
}
